// import.meta.globEager() 直接引入所有的模块 Vite 独有的功能
import { FilterRouter } from '@/router/types';

const modules = import.meta.glob('./modules/**/*.ts', { eager: true });

const filtrateList: FilterRouter = {};
// 加入到路由集合中
Object.keys(modules).forEach((key) => {
  const mod = (modules as Recordable)[key].default || {};
  Object.assign(filtrateList, mod);
});

export const filtrateRouteList = filtrateList;
